<?php
/* @var $this BlockController */
/* @var $model Block */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'action'=>isset($action)?'':$this->pre_module_url.'/afterSales/create',
	'id'=>'block-_forms-form',
	'htmlOptions'=>array('class'=>'create_temp'),
	'enableAjaxValidation'=>false,
)); ?>
	<?php echo $form->hiddenField($model,'zm_id'); ?>
	<?php echo $form->hiddenField($model,'zbl_type'); ?>
	<?php echo $form->hiddenField($model,'zbl_pos'); ?>
	<ul class="form_list">
		<li class="c_f">
			<span class="tit"></span>
            <div class="cont f_l">
			<?php echo $form->errorSummary($model); ?>
            </div>
		</li>

		<li class="c_f">
			<span class="tit"><em class="xing">*</em>模板名称：</span>
            <div class="cont f_l">
			<?php echo $form->textField($model,'zbl_title',array('maxlength'=>"30",'class'=>'t_ipt ipt_bg w_300','id'=>'after_sales_title')); ?>
			<span class="c_666" id='after_sales_titleTip'></span>
            </div>
		</li>

		<li class="c_f">
			<span class="tit"><em class="xing">*</em>售后服务：</span>
            <div class="cont f_l">
			<?php  $this->widget('ext.keditor.KEditor',array(  
	            'model'=>$model,  //传入form model  
	            'name'=>'zbl_data', //设置name
	           // 'htmlOptions'=>array('id'=>'after_sales_content'), 
	            'properties'=>array(  
	                //设置接收文件上传的action  
	                'uploadJson'=>'/Attachment/GetAjax',  
	                //设置浏览服务器文件的action，这两个就是上面配置在/admin/default的  
	             //   'fileManagerJson'=>'/Attachment/GetAjax',  
	                'newlineTag'=>'br',  
	                'allowFileManager'=>true,  
	                //传值前加js:来标记这些是js代码  
	                'afterCreate'=>"js:function() {  
	                        K('#ChapterForm_all_len').val(this.count());  
	                        K('#ChapterForm_word_len').val(this.count('text'));  
	                    }",  
	                'afterChange'=>"js:function() {  
	                        K('#ChapterForm_all_len').val(this.count());  
	                        K('#ChapterForm_word_len').val(this.count('text'));  
	                    }",  
	            ),   
	            'textareaOptions'=>array(  
	                'style'=>'width:635px;height:261px;',  
	            )  
	        )); ?> 
            </div>
		</li>
		<li class="c_f">
			<span class="tit">&nbsp;</span>
            <div class="cont f_l">
			<span class="c_666" id='Block_zbl_dataTip'></span>
            </div>
		</li>
	</ul>
	<div class="save_link">
		<?php echo CHtml::submitButton(Yii::t('cmp','Save'),array('class'=>'mem_btn mem_btn18')); ?>
		<?php echo CHtml::resetButton(Yii::t('cmp','Cancel'),array('class'=>'mem_btn mem_btn07')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->

<script>
jQuery(document).ready(function($) {
	$.formValidator.initConfig({theme:"Default",formID:"block-_forms-form",
		onError:function(msg, obj){
					alert(msg);
					$(".element_box").hide();
					$(obj).closest(".element_box").show();
					$(".sub_nav ul li").removeClass("select");
					if($(obj).closest(".element_box").next().hasClass("element_box")){
						$(".sub_nav ul li").eq(0).addClass("select");
					}else{
						$(".sub_nav ul li").eq(1).addClass("select");
					}
					return false;
				},
		onsuccess:function(){ return true; }        
	});
})
</script> 
<script type="text/javascript" src="<?php echo Yii::app()->baseUrl;?>/js/formvalidata/formValidator-4.1.1.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->baseUrl;?>/js/formvalidata/formValidatorRegex.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->baseUrl;?>/js/formvalidata/cmpValidate.js"></script>